﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using sexhealth.console.service.post.vo;
using sexhealth.console.service.post;

public partial class usercontrol_IndexNewsList : System.Web.UI.UserControl
{
    PostService postService = new PostService();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("<table width='241' border='0' cellpadding='0' cellspacing='0'>");
            foreach (PostVO p in postService.GetPostList(10,5))
            {
                sb.Append("<tr>");
                sb.Append("<td width='17' valign='top'>");
                sb.Append("<img src='image/icon01.gif' width='7' height='6' class='icon01' />");
                sb.Append("</td>");
                sb.Append("<td width='224'>");
                sb.Append("<a href='postdetail.aspx?chid=10&pid=" + p.PostNo + "' class='b01'>" + p.Title + "</a>");
                sb.Append("</td>");
                sb.Append("</tr>");
            }
            sb.Append("</table>");
            ltlList.Text = sb.ToString();
        }     
    }
    
                                            
                                        
                                        
}
